
/**
 * 单例模式，如果有实例，就返回，没有，就创建一个并且返回
 */
const SingleTone = (function () {
    let _instance = null

    function Single(){
        return{
            publicMethod:function (){},
            publicProperty:'1'
        }
    }

    return function (){
        if(!_instance){
            _instance = Single()
        }
        return _instance;
    }
})()

console.log(SingleTone().publicProperty)
